//钢筋技术优化
import request from '@/utils/request'
import { technicalApiUrl } from './config.js'
//钢筋技术优化列表
export function dataList(data) {
  return request({
    url: technicalApiUrl + '/technical/steel-list',
    method: 'post',
    data: data
  })
}

// 新增
export function addSteel(data) {
  return request({
    url: technicalApiUrl + '/technical/steel/information-new',
    method: 'post',
    data
  })
}

//打印
export function print(query) {
  console.log(query)
  return request({
    url: technicalApiUrl+'/technical/steel/print',
    method: 'get',
    params: query
  })
}

// 编辑
export function updateSteel(data) {
  return request({
    url: technicalApiUrl + '/technical/steel/information',
    method: 'post',
    data
  })
}

// 详情
export function getSteelDetail(id) {
  return request({
    url: technicalApiUrl + `/technical/steel/${id}`,
    method: 'get'
  })
}

//删除优化项
export function tableDelete(params) {
  return request({
    url: technicalApiUrl + `/technical/steel-table/del`,
    method: 'post',
    params
  })
}

//组织信息查询
export function company(data) {
  return request({
    url: technicalApiUrl + `/orgs/page`,
    method: 'get',
    params: data
  })
}

/**
 * 钢筋优化统计
 */
export function getSteelTotalInfo(data) {
  return request({
    url: technicalApiUrl + '/technical/optimization/count',
    method: 'post',
    data
  })
}

/**
 * 钢筋优化率排名
 */
export function getSteelRankList(data) {
  return request({
    url: technicalApiUrl + '/technical/optimization/order-count',
    method: 'post',
    data
  })
}
